<script>
export default {
  name: "TabarItem",
  props:["content"],
  methods:{
    handleClick(){
      console.log(this.navTitle)
      // this.navTitle = this.content  非响应的 因此修改不会生效
      this.app.navTitle = this.content //app是响应式的对象
    }
  },
  inject:["navTitle","app"]
}
</script>

<template>
  <li @click="handleClick">{{content}}</li>
</template>
<style scoped>

</style>